package com.ibuonline.b2b.stat.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import org.springframework.jdbc.core.RowMapper;

import com.dimeng.common.base.SuperDAO;
import com.ibuonline.b2b.entity.StatInfoDaily;

@SuppressWarnings("unchecked")
public class StatInfoDailyDAO extends SuperDAO{

	 public List<StatInfoDaily> queryStatInfoDailysList(String sql,String start,String end){
		 return super.jdbcTemplate.query(sql, new Object[]{start,end}, new RowMapper() {

			@Override
			public Object mapRow(ResultSet rs, int index) throws SQLException {
				StatInfoDaily statInfoDaily = new StatInfoDaily();
				statInfoDaily.setStatDate(rs.getTimestamp("stat_date"));
				statInfoDaily.setMember(rs.getInt("member"));
				statInfoDaily.setCompanyReject(rs.getInt("company_reject"));
				statInfoDaily.setCompany(rs.getInt("company"));
				statInfoDaily.setLogin(rs.getInt("login"));
				statInfoDaily.setSupply(rs.getInt("supply"));
				statInfoDaily.setSupplyReject(rs.getInt("supply_reject"));
				statInfoDaily.setSupplyPublish(rs.getInt("supply_publish"));
				statInfoDaily.setBuy(rs.getInt("buy"));
				statInfoDaily.setBuyPublish(rs.getInt("buy_publish"));
				statInfoDaily.setInquiry(rs.getInt("inquiry"));
				statInfoDaily.setGoldShop(rs.getInt("gold_shop"));
				statInfoDaily.setGoldBooth(rs.getInt("gold_booth"));
				statInfoDaily.setGoldSupplier(rs.getInt("gold_supplier"));
				return statInfoDaily;
			}
		});
	 }

}
